jsx3.Class.defineClass(
        "tibco.admin.Profile",
        null,
        null,
        function (profile) {

    profile.callchangePassword = function() {
      var objService = tibco.admin.Main.loadService("tibco.admin","rules/changePassword.xml","changePassword");
      objService.setEndpointURL(tibco.admin.util.ServiceHelper.getUserMgtEndpointURL());
      //subscribe and call
      objService.subscribe(jsx3.net.Service.ON_SUCCESS, profile.onchangePasswordSuccess);
      objService.doCall();
    };

    profile.onchangePasswordSuccess = function(objEvent) {
      //var responseXML = objEvent.target.getInboundDocument();
      if(objEvent.target.success){
        profile.block.doClose();
      }

    };

    profile.onchangePasswordError = function(objEvent) {
    };

    profile.onchangePasswordInvalid = function(objEvent) {
    };

    profile.onAfterDeserialize = function(objJSX){
      profile.block = objJSX;
    };

    profile.validate = function(){
        if(profile.block.getDescendantOfName("txtNewPassword_0009").getValue() != profile.block.getDescendantOfName("txtConfirmNewPassword_0009").getValue()){
            tibco.admin.Main.alert(tibco.admin.Main.getServer().getDynamicProperty("@@msgValidationFailedTitle_009"),tibco.admin.Main.getServer().getDynamicProperty("@@msgNewPasswordDoNotMatch_009"));
            return false;
        }
        return true;
    };

    profile.onOK = function(){
        if(profile.validate()){
            profile.callchangePassword();
        }
    };

  });
